package com.imooc.converter;

import com.imooc.dataobject.ProductCategory;
import com.imooc.form.CategoryForm;
import org.springframework.beans.BeanUtils;

/**
 * FileName: CategoryForm2ProductCategoryConverter.java
 * Description: TODO
 *
 * @author HuangRI(874668739 @ qq.com)
 * @version 1.0
 * @date 2020/12/31
 */
public final class CategoryForm2ProductCategoryConverter {

    private  CategoryForm2ProductCategoryConverter() {}

    public static ProductCategory convert(CategoryForm categoryForm) {
        ProductCategory productCategory = new ProductCategory();
        if (null == categoryForm) {
            return productCategory;
        }
        BeanUtils.copyProperties(categoryForm, productCategory);
        return productCategory;
    }
}
